<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<form action="orderlist.do" name="search" method="get">

<table width="800" border="0" cellspacing="0" cellpadding="2">
	<tr bgcolor="#fadded">
		<th>주문번호</th>
		<th>상품명</th>
		<th>최종구매자</th>
		<th>구매날짜</th>
		<th>수량</th>
		<th>구매가</th>
		<th>최종구매가</th>
	</tr>
	<tr bgcolor="#e10380">
		<td height="1" colspan="7"></td>
	</tr>
	<!-- 리스트 불러오는 부분 -->
	<c:forEach var="article" items="${list}">
			<c:if test="${article.userid == userid}">
				<tr>
					<td align="center">
						${number}<br>
						<c:set var="number" value="${number-1}"/>
					</td>
					<td align="center">
						<a href="orderdetail.do?or_num=${article.or_num}">${article.or_name}</a>
					</td>
					<td align="center">${article.or_dname}</td>
					<td align="center"><fmt:formatDate value="${article.or_date}" pattern="yyyy년MM월dd일"/></td>
					<td align="center">${article.or_qtity}</td>
					<td align="center">${article.or_total}</td>
					<td align="center">${article.or_finaltotal}</td>
				</tr>
			</c:if>
	</c:forEach>
	<!-- 리스트가 없으면 출력 -->
	<c:if test="${count == 0}">
		<tr align="center">
			<td colspan="7">등록된 게시물이 없습니다.</td>
		</tr>
			<tr bgcolor="#777777">
			<td height="1" colspan="7"></td>
		</tr>
	</c:if>
	<tr>
		<td align="center" colspan="7">${pagingHtml}</td>
	</tr>
</table>
</form>